package com.szholly.data.general.configuration;

import com.szholly.utils.util.PropertiesUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/*
 * 定义默认配置信息读取类
 */
@Configuration
@PropertySource(value = "application.properties")
public class DefulatConfig {

	/*
	 * 连接池启动时的初始值
	 */
	@Value("${initialSize}")
	public int initialSize;
	/*
	 * 连接池的最大值
	 */
	@Value("${maxActive}")
	public int maxActive;
	/*
	 * 最大空闲值.当经过一个高峰时间后，连接池可以慢慢将已经用不到的连接慢慢释放一部分，一直减少到maxIdle为止
	 */
	@Value("${maxIdle}")
	public int maxIdle;
	/*
	 * 最小空闲值.当空闲的连接数少于阀值时，连接池就会预申请去一些连接，以免洪峰来时来不及申请
	 */
	@Value("${minIdle}")
	public int minIdle;

	/*
	 * 服务地址
	 */
	@Value("${Server}")
	public String Server;

	/*
	 * 服务端口号
	 */
	@Value("${Port}")
	public String Port="3306";

	/*
	 * 数据库名称
	 */
	@Value("${Database}")
	public String Database;

	/*
	 * Oracle的本地客户端名称
	 */
	@Value("${NetName}")
	public String NetName;

	/*
	 * 用户名
	 */
	@Value("${UserID}")
	public String UserID;

	/*
	 * 密码
	 */
	@Value("${Password}")
	public String Password;

	/*
	 * 数据库版本
	 */
	@Value("${Version}")
	public String Version;

	/*
	 * 数据库类型
	 */
	@Value("${DbProvideType}")
	public int DbProvideType;

	public int getInitialSize() {
		return initialSize;
	}

	public void setInitialSize(int initialSize) {
		this.initialSize = initialSize;
	}

	public int getMaxActive() {
		return maxActive;
	}

	public void setMaxActive(int maxActive) {
		this.maxActive = maxActive;
	}

	public int getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(int maxIdle) {
		this.maxIdle = maxIdle;
	}

	public int getMinIdle() {
		return minIdle;
	}

	public void setMinIdle(int minIdle) {
		this.minIdle = minIdle;
	}

	public String getServer() {
		return Server;
	}

	public void setServer(String server) {
		Server = server;
	}

	public String getPort() {
		return Port;
	}

	public void setPort(String port) {
		Port = port;
	}

	public String getDatabase() {
		return Database;
	}

	public void setDatabase(String database) {
		Database = database;
	}

	public String getNetName() {
		return NetName;
	}

	public void setNetName(String netName) {
		NetName = netName;
	}

	public String getUserID() {
		return UserID;
	}

	public void setUserID(String userID) {
		UserID = userID;
	}

	public String getPassword() {
		return Password;
	}

	public void setPassword(String password) {
		Password = password;
	}

	public String getVersion() {
		return Version;
	}

	public void setVersion(String version) {
		Version = version;
	}

	public int getDbProvideType() {
		return DbProvideType;
	}

	public void setDbProvideType(int dbProvideType) {
		DbProvideType = dbProvideType;
	}
}
